import 'package:my_flutter_core/models/app_info.dart';
import 'package:my_flutter_core/utils/format_utils.dart';

class CheckAppUpdateResult {
  CheckAppUpdateResult({this.hasUpdate, this.appInfo, this.sharingH5Url});

  factory CheckAppUpdateResult.fromJson(Map<String, dynamic> json) {
    return CheckAppUpdateResult(
      hasUpdate: json['hasUpdate'] as bool,
      appInfo: tryToConvert<AppInfo>(
        json['appInfo'],
        (p) => AppInfo.fromJson(p),
      ),
      sharingH5Url: json['sharingH5Url'],
    );
  }

  final bool? hasUpdate;
  final AppInfo? appInfo;
  final String? sharingH5Url;
}
